package com.guo.fristspringboot.controller;

import com.guo.fristspringboot.entity.Course;
import com.guo.fristspringboot.entity.Student;
import com.guo.fristspringboot.mapper.CourseMapper;
import com.guo.fristspringboot.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cou")
public class CourseController {

    @Autowired
    private CourseMapper courseMapper;

    @RequestMapping("/getAll")
    public List<Course> getAll(){
        return courseMapper.getAll();
    }

    @RequestMapping("/getById")
    public Course getById(){
        Course b=courseMapper.getById("1");
        System.out.println(b.toString());
        return courseMapper.getById("1");
    }

    @RequestMapping("/getAllAnd")
    public Course getAllAnd(){
        Course b=courseMapper.getAllAnd("01");
        System.out.println(b.toString());
        return b;
    }
}
